package com.ruoyi.system.api.model;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.system.api.domain.SysDept;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 公司表 sys_dept
 *
 * @author ruoyi
 */

@Data
public class SysDeptVo extends SysDept {
    private String id;

    @ApiModelProperty(value = "主体编号-编号规则中包含上类型")
    private String subjectNum;

    @ExcelProperty("主体类型")
    @ApiModelProperty(value = "主体类型:个人, 企业")
    private String subjectType;

    @ExcelProperty("主体角色")
    @ApiModelProperty(value = "主体角色 供=应商、利废企业、再生资源企业")
    private String subjectRole;

    @ExcelProperty("名称")
    @ApiModelProperty(value = "名称")
    private String companyName;


    @ExcelProperty("主体简称")
    @ApiModelProperty(value = "主体名称-企业名称&个体名称")
    private String companyShortName;

    @ExcelProperty("企业统一社会信用代码")
    @ApiModelProperty(value = "统一社会信用代码-税号")
    private String companyCode;

    @ExcelProperty("工商类型")
    @ApiModelProperty(value = "工商类型")
    private String companyType;

    @ExcelProperty("注册资本")
    @ApiModelProperty(value = "注册资本")
    private String registeredCapital;

    @ExcelProperty("法人名称")
    @ApiModelProperty(value = "法人姓名")
    private String legalName;

    @ExcelProperty("固定电话")
    @ApiModelProperty(value = "固定电话")
    private String legalPhone;

    @ExcelProperty("法人证件类型")
    @ApiModelProperty(value = "法人证件类型")
    private String legalIdType;

    @ExcelProperty("法人证件号码")
    @ApiModelProperty(value = "法人证件号")
    private String legalIdCard;

    @ExcelProperty("成立日期")
    @ApiModelProperty(value = "成立日期")
    private String registeredDate;


    @ExcelProperty("经营范围")
    @ApiModelProperty(value = "经营范围")
    private String businessScope;

    @ExcelProperty("登记日期")
    @ApiModelProperty(value = "登记日期")
    private String approvedDate;

    @ExcelProperty("营业期限")
    @ApiModelProperty(value = "营业期限 ")
    private String expiryDate;


    @ExcelProperty("登记机关")
    @ApiModelProperty(value = "登记机关发证机关   ")
    private String agency;

    @ExcelProperty("注册地址")
    @ApiModelProperty(value = "注册地址")
    private String registeredAddr;

    @ExcelProperty("联系电话")
    @ApiModelProperty(value = "联系电话")
    private String contactPersonPhone;


    @ExcelProperty("联系人名称")
    @ApiModelProperty(value = "联系人名称")
    private String contactPerson;


    @ExcelProperty("开户银行")
    @ApiModelProperty(value = "开户银行")
    private String openBank;

    @ExcelProperty("开户行账号")
    @ApiModelProperty(value = "开户行账号")
    private String bankAccno;

    @ApiModelProperty(value = "认证状态 1 已认证 2 待认证 3 认证中 4认证失败")
    private String rzStatus;

    @ApiModelProperty(value = "行政区划代码")
    private String xzqhCode;

    @ApiModelProperty(value = "业务负责人名称")
    private String salePersonName;

    @ApiModelProperty(value = "业务负责人联系方式")
    private String salePersonPhone;

    @ApiModelProperty(value = "当前状态 如=运营中、停业等")
    private String companyStatus;

    /**
     * 营业执照照片
     */
    @ApiModelProperty(value = "营业执照照片")
    private String companyImg;

    /**
     * 录入人
     */
    @ApiModelProperty(value = "录入人")
    private String createUser;

    /**
     * 录入日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private String createDate;

    @ExcelProperty("所属公司编码")
    @ApiModelProperty(value = "")
    private String orgCode;

    @ApiModelProperty(value = "天眼评分")
    private Integer tianyanScore;

    @ApiModelProperty(value = "其他图片")
    private String otherImg;
    @ApiModelProperty(value = "基本信息照片")
    private String baseImg;
    @ApiModelProperty(value = "法人身份证照片")
    private String idCardImg;
    @ApiModelProperty(value = "供应商标签")
    private String label;
    @ApiModelProperty(value = "联系地址")
    private String standardAddress;


    @ApiModelProperty(value = "场地位置经度")
    private double standardLng;

    @ApiModelProperty(value = "场地位置纬度")
    private double standardLat;


    private String dataSource;


    public String getCompanyImg() {
        if (StringUtils.isNotEmpty(companyImg) && !companyImg.contains("http")) {

            return "https://data.lvlianhengsheng.com/dev-api/file/fileAttachmentInfo/viewImage?key=" + companyImg;
        }
        return companyImg;
    }


    public String getOtherImg() {
        if (StringUtils.isNotEmpty(otherImg) && !otherImg.contains("http")) {

            return "https://data.lvlianhengsheng.com/dev-api/file/fileAttachmentInfo/viewImage?key=" + otherImg;
        }
        return otherImg;
    }

    public String getBaseImg() {
        if (StringUtils.isNotEmpty(baseImg) && !baseImg.contains("http")) {

            return "https://data.lvlianhengsheng.com/dev-api/file/fileAttachmentInfo/viewImage?key=" + baseImg;
        }
        return baseImg;
    }

    public String getIdCardImg() {
        if (StringUtils.isNotEmpty(idCardImg) && !idCardImg.contains("http")) {

            return "https://data.lvlianhengsheng.com/dev-api/file/fileAttachmentInfo/viewImage?key=" + idCardImg;
        }
        return idCardImg;
    }

    public String getRegisteredDate() {
        if (StringUtils.isNotEmpty(registeredDate)) {
            return DateUtils.unifyDateFormats(registeredDate);
        }
        return registeredDate;
    }


    public String getExpiryDate() {
        if (StringUtils.isNotEmpty(expiryDate)) {
            return DateUtils.unifyDateFormats(expiryDate);
        }

        return expiryDate;
    }

    public String getApprovedDate() {
        if (StringUtils.isNotEmpty(expiryDate)) {
            return DateUtils.unifyDateFormats(expiryDate);
        }
        return approvedDate;
    }

    //个人信息
    @ExcelProperty("户籍地址")
    @ApiModelProperty(value = "户籍地址")
    private String address;

    @ExcelProperty("证件类型")
    @ApiModelProperty(value = "证件类型")
    private String idType;

    @ExcelProperty("证件号码")
    @ApiModelProperty(value = "个人证件号码")
    private String idNum;

    @Override
    public String getCompanyCode() {
        return companyCode;
    }

    @Override
    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    @Override
    public String getOrgCode() {
        return orgCode;
    }

    @Override
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
}